import axios from "@/api/axios";

const getCode = (sid) => {
  return axios.get("/public/captcha", {
    params: {
      sid: sid
    }
  });
};

const login = (params) => {
  return axios.post("/user/login", {
    ...params
  });
}

const reg = (params) => {
  return axios.post("/user/reg", {
    ...params
  });
}

const forget = option => {
  return axios.post("/forget", {
    ...option
  });
};

const testRequest = () => {
  return axios.request({
    method: "delete",
    url: "/public/captcha",
    data: {
      id: 3
    }
  });
};

export { 
  getCode, 
  reg,
  forget,
  login,
};
